<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base target="_self">
    <title>交费明细列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="交费,明细,列表">
	<meta http-equiv="description" content="This is my page">

	<style type="text/css">
	.indexDiv
	{
		width:700px;
		height:23px;
		display:inline;
		float:left;
		border-style:solid;
		border-width:1px;
		border-color:lightblue;
		padding: 2px 2px 2px 2px;
		margin:2px 6px 8px 2px;
	}
	</style>

  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="tuitionDetailManage.action" namespace="/inner/charge">
    		
    		<s:hidden name="tdvo.td.id" id="tuitionId"></s:hidden>
    		<s:hidden name="tuition.child.id" id="childId"></s:hidden>
    		<s:hidden name="kindergartenId" id="kindergartenId"></s:hidden>
    		
    		<div id="listDiv" style="display:inline-block; float:left; overflow:visible;">
	    		<table cellspacing="1" width="100%" bgcolor="#CCCCCC">
					<tr bgcolor="#FFFFFF">
						<td align="right" width="10%" class="label">
							指标：
						</td>
						<td align="left" width="23%">
							<s:select name="tdvo.indexId" id="indexId" list="indexList" listKey="id" listValue="indexName" headerKey="" headerValue="--请选择--" cssStyle="width:120px" cssClass="search"></s:select>
						</td>
						<td align="right" width="10%" class="label">
							时间：
						</td>
						<td align="left" width="23%">
							<input type="text" name="tdvo.yearMonth" id="yearMonth" value="<s:property value='tdvo.yearMonth' />" style="width:100px" class="WDate search" onfocus="WdatePicker({dateFmt:'yyyy-MM'})" />
						</td>
						<td align="left" width="34%"></td>
					</tr>
				</table>
	    		
	    		<table cellspacing="0" width="100%">
					<tr>
						<td align="left">
							<input type="button" value="查询" class="btn" onclick="searchThis()"/>
							<my:hasPermission privilegeId="delTuitionDetail">
							<input type="button" value="删除" class="btn" onclick="delTuitionDetail()"/>
							</my:hasPermission>
							<input type="button" value="重置" class="btn" onclick="resetSearch()"/>
						</td>
					</tr>
				</table>
	    		
	    		<table cellspacing="0" cellpadding="0" width="100%">
	    			<tr>
	    				<td align="left">
	    					<s:iterator value="lp.list" status="s">
								<div class="indexDiv" id="indexDiv<s:property value='id' />">
									<nobr>
										<div style="width:40px; display:inline-block; float:left;">
											<input name="tdIds" type="checkbox" value="<s:property value='id' />" />
										</div>
										<div style="width:50px; display:inline-block; float:left; line-height:22px;">
											<s:property value="(pager.thisPage - 1) * pager.pageSize + #s.index + 1" />
										</div>
										<div style="width:140px; display:inline-block; float:left; line-height:22px;">
											<s:property value='indexName' />
										</div>
										<div style="width:140px; display:inline-block; float:left; line-height:22px;">
											￥&nbsp;<s:property value='intAmount' />
										</div>
										<div style="width:100px; display:inline-block; float:left; line-height:22px;">
											<s:date name="tuitionDateStart" format="yyyy-MM-dd" />&nbsp;&nbsp;&nbsp;至
										</div>
										<div style="width:100px; display:inline-block; float:left; line-height:22px;">
											<s:date name="tuitionDateEnd" format="yyyy-MM-dd" />&nbsp;
										</div>
										<s:if test='@com.pk.platform.util.constant.ChargeConstant@SCHOOLING.equals(indexName)'>
										<div style="width:100px; display:inline-block; float:left; line-height:22px;">
											折扣：<s:property value='discount' />
										</div>
										</s:if>
									</nobr>
								</div>
							</s:iterator>
	    				</td>
	    			</tr>
		    		<jsp:include page="/common/pager/pager.jsp">
						<jsp:param name="formName" value="frm" />
						<jsp:param name="id" value="1" />
					</jsp:include>
	    		</table>
	    		
	    		<table cellpadding="0" cellspacing="0" width="100%">
					<tr>
						<td width="50%" align="left" height="30px">
							<my:hasPermission privilegeId="superAddTuitionDetail">
							<a href="javascript:toSelectChargeTemp()">费用追加</a>
							</my:hasPermission>
						</td>
						<td width="35%" align="right">
							总金额（￥）：
						</td>
						<td width="15%" align="left">
							<div style="display:inline; width:100px;" id="totalAmountDiv" align="left">
								<s:property value="totalAmount"/>
							</div>
						</td>
					</tr>
				</table>
    		</div>
    	</s:form>
    </center>
    
    <script type="text/javascript">
	$(function(){
		var indexFrame = parent.$('#indexFrame');
		var listDiv = $('#listDiv');
		if(indexFrame.length > 0)
		{
			indexFrame.height(listDiv.height() + 20);
		}
	});
	
    function toSelectChargeTemp()
    {
    	var kgId = parent.getTopKg();
    	var childId = $('#childId');
    	var tuitionId = $('#tuitionId');
    	var obj = selectOneChargeTemp(kgId, childId.val());
    	if(obj != null)
    	{
    		if('temp' == obj.type)
    		{
   				var url = realPath + '/inner/charge/toAddTuitionDetail.action?tuition.id=' + tuitionId.val() + '&ct.id=' + obj.id;
   				showMd(url, 850, 600, 'yes', 'yes');
   			}
   			else if('manual' == obj.type)
   			{
   				var url = realPath + '/inner/charge/toAddTuitionDetailManual.action?tuition.id=' + tuitionId.val();
   				showMd(url, 850, 600, 'yes', 'yes');
   			}
    	}
    }
    
    function searchThis()
    {
    	$('#thisPage').val(1);
    	$('#frm').submit();
    }
    
    function delTuitionDetail()
    {
    	if(hasCheck('tdIds') == false)
    		return;
    	showConfirm('确认删除？', function(v){
    		if(v == true)
    		{
		    	var url = 'inner/charge/delTuitionDetail.action';
		    	ajaxAction(url, 'post', 'frm', false, function(){
		    		searchThis();
		    	});
		    }
		});
    }
    </script>
  </body>
</html>
